<template>
<!--  给Demo组件 绑定了hello事件 若触发 就调用showHelloMsg方法-->
  <Demo @hello="showHelloMsg" msg="nihaoa" school="shangguigu">
    <template v-slot:qwe>
      <span>shangguigu</span>
      <span>shangguigu22</span>
    </template>
    <template v-slot:asd>
      <span>shangguigu</span>
      <span>shangguigu22</span>
    </template>

  </Demo>
</template>

<script>
import Demo from "@/components/Demo.vue";
export default {
  name: 'App',
  components:{Demo},
  setup:function (){
    function showHelloMsg(val){
      alert(`你好啊，你触发了hello事件，我收到的参数是：${val}`)
    }
    return {
      showHelloMsg
    }
  }


}
</script>


